// eslint-disable-next-line @typescript-eslint/no-unused-vars
export default (props, ctx, methods) => {
  const downloadResource = (url: string, name: string) => {
    const a = document.createElement('a')
    a.setAttribute('href', url) // a.href='文件链接'
    a.setAttribute('download', name) // a.download='文件名'
    a.click()
  }

  return {
    downloadResource
  }
}
